<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8" />
    <title>项目配置</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta
            name="viewport"
            content="width=device-width, initial-scale=1, maximum-scale=1"
    />
    <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
    <!--    <link rel="stylesheet" href="../css/amis/sdk.css" />-->
    <link rel="stylesheet" href="https://houtai.baidu.com/v2/csssdk"/>
    <style>
        html,
        body,
        .app-wrapper {
            position: relative;
            width: 100%;
            height: 100%;
            margin: 0;
            padding: 0;
        }
    </style>
</head>
<body>
<div id="root" class="app-wrapper"></div>
<!--<script src="../js/amis/sdk.js"></script>-->
<!--<script src="../js/jquery-3.3.1.min.js" type="text/javascript" charset="utf-8"></script>-->
<script src="https://houtai.baidu.com/v2/jssdk"></script>
<script type="text/javascript">

    (function () {
        let amis = amisRequire('amis/embed');
        let amisScoped = amis.embed('#root',
        {
  "title": "项目配置管理",
  "toolbar": [
    {
      "type": "button",
      "actionType": "dialog",
      "label": "新增",
      "icon": "fa fa-plus pull-left",
      "primary": true,
      "dialog": {
        "title": "新增项目配置信息",
        "size": "lg",
        "body": {
          "type": "form",
          "name": "sample-edit-form",
          "columnCount": 2,
          "api": "post:/projectConfig/add",
          "body": [
            {
              "type": "input-text",
              "name": "projectCode",
              "label": "项目应用编码",
              "required": true
            },
            {
              "type": "input-text",
              "name": "projectDesc",
              "label": "项目应用描述",
              "required": true
            },
            {
              "type": "input-text",
              "name": "domainCode",
              "label": "业务领域编码",
              "required": true
            },
            {
              "type": "input-text",
              "name": "domainDesc",
              "label": "业务领域描述",
              "required": true
            },
            {
              "type": "input-text",
              "name": "devUrl",
              "label": "开发环境域名",
              "required": true,
                "label": "只允许 http 打头的 url",
                "validations": {
                    "isUrl": {
                        "schemes": [
                            "http"
                        ]
                    }
                }
            },
            {
              "type": "input-text",
              "name": "testUrl",
              "label": "测试环境域名",
              "required": true,
                "label": "只允许 http 打头的 url",
                "validations": {
                    "isUrl": {
                        "schemes": [
                            "http"
                        ]
                    }
                }
            },
            {
              "type": "input-text",
              "name": "preUrl",
              "label": "预发环境域名",
              "required": true,
              "label": "只允许 http 打头的 url",
                "validations": {
                    "isUrl": {
                        "schemes": [
                            "http"
                        ]
                    }
                }
            },
            {
              "type": "input-text",
              "name": "proUrl",
              "label": "生产环境域名",
              "required": true,"label": "只允许 https 打头的 url",
                "validations": {
                    "isUrl": {
                        "schemes": [
                            "https"
                        ]
                    }
                }
            },
            {
               "type": "input-file",
               "name": "file",
               "label": "plantUML API 文档",
               "accept": ".puml",
               "receiver": "/apidoc/upload"
            },
            {
              "type": "select",
              "name": "dslAppName",
              "label": "前端dsl框架",
              "options": [
                {
                    "label": "Amis",
                    "value": "amis"
                },
                {
                    "label": "vueElementUi",
                    "value": "vueelementui"
                },
                {
                    "label": "antDesign",
                    "value": "antdesign"
                }
              ]
            }
          ]
        }
      }
    },
    {
      "type": "nav",
      "links": [
        {
          "label": "首页",
          "icon": "fa fa-cloud",
          "to": "./start"
        }]
    }
  ],
  "body": {
    "type": "crud",
    "draggable": true,
    "api": "/projectConfig/pagelist",
    "perPage": 5,
    "keepItemSelectionOnPageChange": true,
    "maxKeepItemSelectionLength": 11,
    "labelTpl": "${id} ${engine}",
    "orderBy": "id",
    "orderDir": "asc",
    "autoGenerateFilter": true,
    "bulkActions": [
      {
        "label": "批量删除",
        "actionType": "ajax",
        "api": "delete:/amis/api/sample/${ids|raw}",
        "confirmText": "确定要批量删除?"
      },
      {
        "label": "批量修改",
        "actionType": "dialog",
        "dialog": {
          "title": "批量编辑",
          "name": "sample-bulk-edit",
          "body": {
            "type": "form",
            "api": "/amis/api/sample/bulkUpdate2",
            "body": [
              {
                "type": "hidden",
                "name": "ids"
              },
              {
                "type": "input-text",
                "name": "engine",
                "label": "Engine"
              }
            ]
          }
        }
      }
    ],
    "quickSaveApi": "/amis/api/sample/bulkUpdate",
    "quickSaveItemApi": "/amis/api/sample/$id",
    "filterTogglable": true,
    "headerToolbar": [
      "filter-toggler",
      "bulkActions",
      {
        "type": "tpl",
        "tpl": "定制内容示例：当前有 ${count} 条数据。",
        "className": "v-middle"
      },
      {
        "type": "link",
        "href": "https://www.baidu.com",
        "body": "百度一下",
        "htmlTarget": "_parent",
        "className": "v-middle"
      },
      {
        "type": "columns-toggler",
        "align": "right"
      },
      {
        "type": "drag-toggler",
        "align": "right"
      },
      {
        "type": "pagination",
        "align": "right"
      }
    ],
    "footerToolbar": [
      "statistics",
      "switch-per-page",
      "pagination"
    ],
    "columns": [
      {
        "name": "id",
        "label": "ID",
        "width": 20,
        "sortable": true
      },
      {
        "name": "projectCode",
        "label": "项目应用编码",
        "sortable": true,
        "type": "text",
        "searchable": {
          "type": "input-text",
          "name": "projectCode",
          "placeholder": "输入项目应用编码"
        }
      },
      {
        "name": "projectDesc",
        "label": "项目应用描述",
        "type": "text",
        "searchable": {
          "type": "input-text",
          "name": "projectDesc",
          "placeholder": "输入项目应用描述"
        }
      },
      {
        "name": "domainCode",
        "label": "业务领域编码",
        "sortable": true,
        "type": "text"
      },
      {
        "name": "domainDesc",
        "label": "业务领域描述",
        "type": "text"
      },
      {
        "type": "text",
        "name": "testUrl",
        "label": "测试环境域名"
      },
      {
        "type": "text",
        "name": "proUrl",
        "label": "生产环境域名"
      },
      {
        "type": "text",
        "name": "gitAddress",
        "label": "项目git地址"
      },
      {
        "type": "operation",
        "label": "操作",
        "width": 100,
        "buttons": [
          {
            "type": "button",
            "icon": "fa fa-eye",
            "actionType": "dialog",
            "tooltip": "查看",
            "dialog": {
              "title": "查看",
              "body": {
                "type": "form",
                "body": [
                  {
                    "type": "static",
                    "name": "projectCode",
                    "label": "项目应用编码"
                  },
                  {
                    "type": "divider"
                  },
                  {
                    "type": "static",
                    "name": "projectDesc",
                    "label": "项目应用描述"
                  },
                  {
                    "type": "divider"
                  },
                  {
                    "type": "static",
                    "name": "domainCode",
                    "label": "业务领域编码"
                  },
                  {
                    "type": "divider"
                  },
                  {
                    "type": "static",
                    "name": "domainDesc",
                    "label": "业务领域描述"
                  },
                  {
                    "type": "divider"
                  },
                  {
                    "type": "static",
                    "name": "testUrl",
                    "label": "测试环境域名"
                  },
                  {
                    "type": "divider"
                  },
                  {
                    "type": "text",
                    "name": "gitAddress",
                    "label": "项目git地址"
                  }
                ]
              }
            }
          },
          {
            "type": "button",
            "icon": "fa fa-pencil",
            "tooltip": "编辑",
            "actionType": "drawer",
            "drawer": {
              "position": "left",
              "size": "lg",
              "title": "编辑",
              "body": {
                "type": "form",
                "name": "sample-edit-form",
                "api": "/projectConfig/update/${id}",
                "body": [
                  {
                    "type": "input-text",
                    "name": "projectCode",
                    "label": "项目应用编码",
                    "required": true
                  },
                  {
                    "type": "divider"
                  },
                  {
                    "type": "input-text",
                    "name": "projectDesc",
                    "label": "项目应用描述",
                    "required": true
                  },
                  {
                    "type": "divider"
                  },
                  {
                    "type": "input-text",
                    "name": "domainCode",
                    "label": "业务领域编码",
                    "required": true
                  },
                  {
                    "type": "divider"
                  },
                  {
                    "type": "input-text",
                    "name": "domainDesc",
                    "label": "业务领域描述"
                  },
                  {
                    "type": "divider"
                  },
                  {
                    "type": "input-text",
                    "name": "devUrl",
                    "label": "开发环境域名"
                  },
                  {
                    "type": "divider"
                  },
                  {
                    "type": "input-text",
                    "name": "testUrl",
                    "label": "测试环境域名"
                  },
                  {
                    "type": "divider"
                  },
                  {
                    "type": "input-text",
                    "name": "preUrl",
                    "label": "预发环境域名"
                  },
                  {
                    "type": "input-text",
                    "name": "proUrl",
                    "label": "生产环境域名"
                  },
                  {
                    "type": "divider"
                  },
                  {
                    "type": "text",
                    "name": "gitAddress",
                    "label": "项目git地址"
                  }
                ]
              }
            }
          },
          {
            "type": "button",
            "icon": "fa fa-times text-danger",
            "actionType": "ajax",
            "tooltip": "删除",
            "confirmText": "您确认要删除?",
            "api": "delete:/amis/api/sample/$id"
          }
        ],
        "toggled": true
      }
    ]
  }
}

        );
    })();
</script>
</body>
</html>